/**
 * Copyright © 2016-2025 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import '../../../../../../../../scss/constants';

.tb-data-key-row {

  .tb-source-field {
    width: 108px;
    min-width: 108px;
  }

  .tb-data-key-input {
    flex: 1;
    min-width: 150px;
    @media #{$mat-gt-sm} {
      flex: 1 1 60%;
    }
  }

  .tb-label-field {
    flex: 1 1 40%;
    min-width: 100px;
  }

  .tb-color-field, .tb-units-field, .tb-decimals-field, .tb-time-series-type-field {
    display: flex;
    flex-direction: row;
    place-content: center;
    align-items: center;
  }

  .tb-units-field {
    width: 80px;
    min-width: 80px;
  }

  .tb-color-field {
    width: 40px;
    min-width: 40px;
  }

  .tb-decimals-field {
    width: 60px;
    min-width: 60px;
  }

  .tb-y-axis-field {
    width: 100px;
    min-width: 100px;
    .mat-mdc-form-field {
      width: 100%;
    }
  }

  .tb-time-series-type-field {
    width: 60px;
    min-width: 60px;
    .mat-icon {
      color: rgba(0,0,0,0.76);
    }
  }

  .tb-label-field, .tb-units-field, .tb-color-field, .tb-decimals-field {
    display: none;
    @media #{$mat-gt-sm} {
      display: flex;
    }
  }

  .tb-y-axis-field {
    @media #{$mat-md} {
      display: none;
    }
  }

  .tb-time-series-type-field {
    @media #{$mat-xs} {
      display: none;
    }
    @media #{$mat-md} {
      display: none;
    }
  }

  .tb-settings-button {
    width: 40px;
    min-width: 40px;
  }

  &.tb-single-row {
    padding: 0;
    .tb-units-field, .tb-decimals-field {
      min-width: 0;
      width: auto;
    }
    .tb-units-field {
      tb-unit-input {
        width: auto;
        max-width: 140px;
      }
    }
    .tb-decimals-field {
      .mat-mdc-form-field {
        width: auto;
        max-width: 140px;
      }
    }
  }
}

.tb-time-series-type-field {
  .mat-mdc-option:not(.mdc-list-item--selected) {
    .mat-icon {
      color: rgba(0,0,0,0.54);
    }
  }
}
